package com.fly.simple;

import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

public class MainRun
{
    /**
     * 线程池保证程序一直运行
     * 
     * @param args
     */
    public static void main(String[] args)
    {
        Executors.newScheduledThreadPool(2).scheduleAtFixedRate(() -> {
            System.out.println("hello world!");
        }, 2, 2, TimeUnit.SECONDS);
    }
}
